<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		[#include "/admin/include/head.htm"]
		<script type="text/javascript">
			$(function(){
				var customData = { "list" : [
					[#if cacheManager?? && cacheManager.cacheNames?has_content]
						[#list cacheManager.cacheNames as name]
							[#assign cache = cacheManager.getEhcache(name)]
							[#if cache?? && cache.statistics??]
							[#assign statis = cache.statistics]
							[/#if]{
								"name":"${name}",
								"totalCount":"[#if statis?? && statis.cacheHits??][#assign totalCount = statis.cacheHits + statis.cacheMisses][#if totalCount <= 0][#assign totalCount = 1][/#if]${statis.cacheHits * 1.0 / (totalCount)}[/#if]",
				            	"cacheHits":"${(statis.cacheHits)!}",
				            	"cacheMisses":"${(statis.cacheMisses)!}",
				            	"objectCount":"${(statis.objectCount)!}",
				            	"searchesPerSecond":"${(statis.searchesPerSecond)!}",
				            	"averageSearchTime":"${(statis.averageSearchTime)!}毫秒",
				            	"averageGetTime":"${(statis.averageGetTime)!}毫秒"
				            	}[#if name_index != cacheManager.cacheNames?size -1],[/#if]
						[/#list]
					[/#if]
				]};
				
			  $("#maingrid").ligerGrid({
		            columns: [
		            {display: '操作', name: 'name', align: 'center', width: 100,
						render:function(row){
							return "<a href='${base}/admin/system/monitor/ehcache/"+row["name"]+"/details.jhtml' style='color:blue'>详细</a>";
					}},
					{display: '缓存名称', name: 'name', align: 'left', width: 200 },
					{display: '总命中率', name: 'totalCount', align: 'center', width: 100 },
					{display: '命中次数', name: 'cacheHits', align: 'center', width: 100 },
					{display: '失效次数', name: 'cacheMisses', align: 'center', width: 100 },
					{display: '缓存总对象数', name: 'objectCount', align: 'center', width: 200 },
					{display: '平均获取时间', name: 'averageGetTime', align: 'center', width: 200 },
					{display: '最后一秒查询完成的执行数', name: 'searchesPerSecond', align: 'center', width: 250 },
					{display: '最后一次采样的平均执行时间', name: 'averageSearchTime', align: 'center', width: 250 }
									
					],  usePager:false, data:customData, checkbox: false,dataAction:"local",
					 width: '100%', height:'100%'
		        });
			});
		</script>
	</head>
	<body style="padding:10px; overflow:hidden;">
		<div id="maingrid" style="margin:0; padding:0"></div>
	</body>
</html>